body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-image: url('pic/back.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: fixed;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    padding: 10px 0;
    text-align: center;
    width: 100%;
    z-index: 10;
}

.header img {
    margin: 40px 50px;
    max-width: 490px;
    height: auto;
}

.control-panel {
    position: fixed;
    left: -150px;  
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;  
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;  
    border-radius: 10px;
    width: 150px;
    transition: left 0.3s ease;  
}

.control-panel::after {
    content: "⚙️";  
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.control-panel:hover {
    left: 0;
}

.btn {
    display: block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #409eff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    text-align: center;
}

.btn.small-btn {
    padding: 4px 8px;  
    font-size: 13px;   
    margin-bottom: 4px; 
}

.btn:hover {
    background-color: #307ecc;
}

#startBtn {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #52c41a;
    color: white;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

#startBtn:hover {
    background-color: #40a80a;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

#stopBtn {
    position: fixed;
    right: 30px;
    top: calc(50% + 120px);
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #ff4d4f;
    color: white;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

#stopBtn:hover {
    background-color: #e03e3e;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;  
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;  
    border-radius: 4px;
}

.input-group label {
    color: white;
    font-size: 14px;
}

.input-group .number-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-group button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #666;
    color: white;
}

.input-group input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #666;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 6px;  
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;  
    border-radius: 4px;
}

.toggle-group label {
    color: white;
    font-size: 13px;  
    text-align: center;
    margin-bottom: 3px;  
}

.toggle-btn {
    padding: 6px;  
    font-size: 13px;  
    border: 1px solid #666;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.toggle-btn.active {
    background: #409eff;
    border-color: #409eff;
}

.result {
    text-align: center;
    font-size: 32px;
    display: none;
    font-weight: bold;
    margin: 0 auto;
    position: fixed;
    top: 500px;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgb(255,208,157);
    width: 90%;
    max-width: 1200px;
}

.flicker {
    text-align: center;
    font-size: 10px;
    display: none;
    font-weight: bold;
    margin: 0 auto;
    position: fixed;
    top: 500px;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgb(255,208,157);
    width: 90%;
    max-width: 1200px;
}

.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1px;
}

.result-table.drawing {
    border-spacing: 8px;
}

.result-table td {
    padding: 5px;
    text-align: center;
    width: 20%;
    vertical-align: middle;
    height: 160px;
}

.result-table.drawing td {
    height: auto;
    font-size: 50px;
    padding: 8px;
}

.winner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.winner-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 3px solid rgb(255,208,157);
    transition: opacity 0.3s;
}

.winner-avatar.hidden {
    opacity: 0;
}

.winner-name {
    font-size: 32px;
    margin: 5px 0;
    min-height: 40px;
    line-height: 40px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    box-sizing: border-box;
}

.winner-id {
    font-size: 24px;
    color: rgba(255,208,157,0.8);
    min-height: 30px;
    line-height: 30px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    box-sizing: border-box;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.close, .close1 {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus,
.close1:hover,
.close1:focus {
    color: black;
    text-decoration: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.modal-body {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
}
